﻿// Copyright 2007-2008 Rory Plaire (codekaizen@gmail.com)

namespace NPack.Interfaces
{
    /// <summary>
    /// Every class that defines a unary - operation
    /// such that <c>x + (-x) = e</c> and <c>-(-x) = x</c> should consider
    /// implementing this interface.
    /// </summary>
    /// <typeparam name="T">Type which is negatable.</typeparam>
    /// <remarks>
    /// Adapted from an article on lambda-computing.com: 
    /// http://www.lambda-computing.com/publications/articles/generics/IArithmetic.cs.
    /// </remarks>
    public interface INegatable<T> : ISubtractable<T>, IHasZero<T>
    {
        /// <summary>
        /// Returns the negative of the Object. Must not modify the Object itself.
        /// </summary>
        /// <returns>The negative.</returns>
        T Negative();
    }
}
